package com.kgc.crowd.springsessiondemo1.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
public class TestController1 {

    @ResponseBody
    @RequestMapping("/index")
    public String index(HttpSession session){
        session.setAttribute("username","admin");
        return "success";
    }
}